package com.abvnet.project.water.project.service;

import com.abvnet.common.utils.text.Convert;
import com.abvnet.project.water.project.domain.ProjectPlan;
import com.abvnet.project.water.project.mapper.ProjectPlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 项目方案 服务层实现
 * 
 * @author duj
 * @date 2019-07-30
 */
@Service
public class ProjectPlanServiceImpl implements IProjectPlanService {
	@Autowired
	private ProjectPlanMapper projectPlanMapper;

	/**
     * 查询项目方案信息
     * 
     * @param planId 项目方案ID
     * @return 项目方案信息
     */
    @Override
	public ProjectPlan selectProjectPlanById(Long planId) {
	    return projectPlanMapper.selectProjectPlanById(planId);
	}
	
	/**
     * 查询项目方案列表
     * 
     * @param projectPlan 项目方案信息
     * @return 项目方案集合
     */
	@Override
	public List<ProjectPlan> selectProjectPlanList(ProjectPlan projectPlan) {
	    return projectPlanMapper.selectProjectPlanList(projectPlan);
	}

    @Override
    public List<ProjectPlan> selectProjectPlanListByProjectId(Long projectId) {
        return projectPlanMapper.selectProjectPlanListByProjectId(projectId);
    }

    /**
     * 新增项目方案
     * 
     * @param projectPlan 项目方案信息
     * @return 结果
     */
	@Override
	public int insertProjectPlan(ProjectPlan projectPlan) {
	    return projectPlanMapper.insertProjectPlan(projectPlan);
	}
	
	/**
     * 修改项目方案
     * 
     * @param projectPlan 项目方案信息
     * @return 结果
     */
	@Override
	public int updateProjectPlan(ProjectPlan projectPlan) {
	    return projectPlanMapper.updateProjectPlan(projectPlan);
	}

	/**
     * 删除项目方案对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteProjectPlanByIds(String ids) {
		return projectPlanMapper.deleteProjectPlanByIds(Convert.toStrArray(ids));
	}
	
}